<div style="position: absolute;top: 120px; left: 450px">
    <font style="font-size: 25px ;color: #e8198b">采购单查询：</font>&nbsp;&nbsp;
    采购单编号：<input type="text" class="su" id="poCode" >&nbsp;
    日期范围：<input type="text" class="su" id="timeRange">
    处理状态:<select id="status" style="border-radius: 50px;
    height: 20px;
    border-color: #0eb4dd; background-color: rgba(62,181,174,0.71)">
                <option value="1">新增</option>
                <option value="2">已付预付款</option>
                <option value="3">已入库</option>
                <option value="4">已付款</option>
                <option value="5">已了结</option>
            </select>
    <input type="button" value="查询" onclick="selectPoMain()" style="background-color: #1E9FFF">

</div>


<br>
<table class="altrowstable">
        <tr>
            <td>编号</td>
            <td>采购单编号</td>
            <td>创建时间</td>
            <td>供应商名称</td>
            <td>创建用户</td>
            <td>附加费用</td>
            <td>采购产品总价</td>
            <td>采购单总价格</td>
            <td>付款方式</td>
            <td>处理状态</td>
            <td>明细</td>
            <td>操作</td>
        </tr>
        <tbody id="poMainBody">

        </tbody>
    <div  style="position: absolute; margin-top: 0px;padding-left: 700px">
        <ul id="page">分页</ul>
    </div>
</table>


<script type="text/html" id="poMainTemplate">
    {{each data}}
    <tr>
        <td>{{$index+1}}</td>
        <td>{{$value.poID}}</td>
        <td>{{$value.createTime}}</td>
        <td>{{$value.venderCode}}</td>
        <td>{{$value.account}}</td>
        <td>{{$value.tipFee}}</td>
        <td>{{$value.productTotal}}</td>
        <td>{{$value.poTotal}}</td>
        <td>{{$value.payType}}</td>
        <td>{{$value.status}}</td>
        <td><font style="color: #e8198b" onclick="{{'getPoItem(\''+ $value.poID +'\')'}}">查看明细</font></td>
        <td><span style="color: #84fab0" onclick="{{'updatePoMain(\''+$value.poID+'\')'}}">修改</span><span style="color: #e8198b" onclick="{{'deletePoMain(\''+$value.poID+'\')'}}">删除</span></td>
    </tr>
    {{/each}}
</script>

<script>
function selectPoMain() {
    var date= $('#timeRange').val();
    var poID = $('#poCode').val();
    var status= $('#status').find("option:selected").val();
   showPage({
       currentPage:1,
       pageSize:3,
       url:'selectPoMain',
       templateId:'poMainTemplate',
       contentId:'poMainBody',
       params:{
           date:date,
           poID:poID,
           status:status
       }

   })
}





    function deletePoMain(ObJ) {
        Ajax.post("deletePoMain",{poID:ObJ},function (result) {
            doResult(result,function () {
                show('showPoMain.html')
            })
        })
    }

    
    
    
    $(function () {
        showPage({
            currentPage: 1,
            pageSize: 3,
            url: '/getAllPoMain',
            templateId: 'poMainTemplate',
            contentId: 'poMainBody',
        })
    })


</script>
<script type="text/javascript">
    laydate.render({
        elem: '#timeRange'

        ,range: "~"
    });
</script>